import Vue from 'vue'
import Vuex from 'vuex'
import * as getters from './getters'
import * as mutations from './mutations'
import * as actions from './actions'

/*使用vuex*/
Vue.use(Vuex);

/*配置全局数据*/
const state = {
  	height: '',
  	width: '',
  	parameter: {
  		bar: {
	        title: {
	          	text: 'EChart6666s'
	        },
	        tooltip: {},
	        xAxis: {
	          	data: ['x1', 'x2', 'x3', 'x4', 'x5', 'x6']
	        },
	        yAxis: {},
	        series: [{
	          	name: 'test',
	          	type: 'bar',
	          	barWidth: 30,
	          	data: [5, 10, 15, 20, 25, 30]
	        }]
    	},
    },
  	components: [],
  	activeComponents: {},
  	option: {
	  	bar: {
	        title: {
	          	text: 'ECharts Hello World'
	        },
	        tooltip: {},
	        xAxis: {
	          	data: ['Shirt', 'Sweater', 'Chiffon', 'Pants', 'Heels', 'Socks']
	        },
	        yAxis: {},
	        series: [{
	          	name: 'Sales',
	          	type: 'bar',
	          	barWidth: 30,
	          	data: [5, 20, 36, 10, 10, 20]
	        }]
    	},
    	circle: {
	        title: {
	          text: 'ECharts'
	        },
	        tooltip: {},
	        
	        series: [{
	          name: 'Clouds',
	          type: 'pie',
	            data:[
	              	{value:15, name:'先进制造业'},
	              	{value:15, name:'交通运输业'},
	              	{value:25, name:'能源'},
	              	{value:10, name:'民生'},
	              	{value:15, name:'基础建设'},
	              	{value:10, name:'水利'},
	              	{value:15, name:'现代服务业'},
	              	{value:25, name:'生态'}
	            ]
	        }]
      	},
      	line: {
	        title: { text: 'ECharts 入门示例' },
	        tooltip: {},
	        xAxis: {
		         	data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"],
		         	axisLabel:{
		         	   interval:0,
		         	}
	        },
	        yAxis: {
	           	max:40,
	           	min:0,
	          	splitNumber:4,
	        },
	        series: [{
	          	name: '销量',
	          	type: 'line',
	          	data: [5, 20, 36, 10, 10, 20]
	        }]
      	},
	},
}


/*将store导出*/
export default new Vuex.Store({
  	state,
  	getters,
  	mutations,
  	actions,
})